package test;

import java.io.*;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

public class Client {

    public static void main(String[] args) {
//socket是虚拟的终端，开启实现IO的虚拟接口
        try {
            Socket client=new Socket("localhost",10086);
            OutputStream outputStream = client.getOutputStream();
            DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
            System.out.println("---------");
          //  dataOutputStream.writeUTF("你好");

            outputStream.write("你好".getBytes(StandardCharsets.UTF_8));

            dataOutputStream.close();
            outputStream.close();
            client.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
